from com.sai.Settings import stagingDir, dataDir
import sqlite3

def printAllMovies():
    print 'path is:'+dataDir+'movdb.sqllite'
    conn = sqlite3.connect(dataDir+'movdb.sqllite')
    
    
    conn.row_factory = sqlite3.Row
    c = conn.cursor()
    #c.execute('''drop table movies''')
    
    conn.commit()
    
    # Create table
    #c.execute('''create table movies (uniquekey text NOT NULL , year numeric, title text, quality text, href text, actors text,unique(uniquekey))''')
    c.execute('''select * from movies''')
    
    for row in c:
        print row["href"]
    
    # Save (commit) the changes
    conn.commit()
    
    # We can also close the cursor if we are done with it
    c.close()


